package com.zx.service.impl;

import com.zx.DAO.UserDao;
import com.zx.entity.User;
import com.zx.service.EnterInte;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @author 程仟磊
 * @date 2021/7/22
 */
@Service
public class EnterImpl implements EnterInte {
    @Resource
    private UserDao enterDao;
    @Override
    public User findLogin(String uaccount, String upsw) {
        return  enterDao.login(uaccount, upsw);
    }

    @Override
    public int addRegister(String uaccount, String upsw, String uphone,String uname) {
        User user=new User();
        user.setUsaccount(uaccount);
        user.setUsname(uname);
        user.setUspsw(upsw);
        user.setUsphone(uphone);
        return enterDao.register(user);
    }

    @Override
    public int findAccount(String uaccount) {
        return enterDao.findAccount(uaccount);
    }
}
